import React, { useEffect, useState } from 'react'
import { getList } from '../../utils/api'
import './One.less'
function HeaderOne() {
    const [list,setList] = useState([])
    useEffect(()=>{
        getList().then(res=>{
            setList(res.data.headerOne.list)
        })
    },[])

    return (
        <div>
          {
            list && list.map((item,index)=>{
                return <div key={index} className='table'>
                    <dl>
                        <dt>{item.title}</dt>
                        <dd>
                            {
                                item.children && item.children.map((v,i)=>{
                                    return <span key={i}>
                                        {v.title}
                                    </span>
                                })
                            }   
                        </dd>
                    </dl>
                </div>
            })
          }
        </div>
    )
}

export default HeaderOne
